<?php

date_default_timezone_set("Asia/Jerusalem");

$modified = 0;
foreach (scandir('.') as $file)
	if (substr($file,-4) == '.php' and filemtime($file) > $modified)
		$modified = filemtime($file);
$modified = date('Y-m-d',$modified);
define('version','nixservices-3.0.0-pre1-'.$modified);
error_log("Loading up ".version."...",E_USER_NOTICE);

$pid = fopen('nixservices3.pid','w') or die('Another proccess is already running.');
fwrite($pid,getmypid());
flock($pid,LOCK_EX);
//set_time_limit(0);

require('watchdog.php');
require('structure.php');
require('autoload.php');

$config = new config();

$sql = new sql();

$irc = new protocol_unreal($config->new_server());
$config->irc_connect($irc);
do {
	$irc->receive();
} while (true);
?>